<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<script type="text/javascript">
$(function(){
	//初始化表单验证
	$("#addForm").validate({
		rules: {
			gbprice: {isMoney: true},
		},
		messages: {
			name: {required: "请输入商品标题"},
			
		},
		submitHandler:function(form){
			$(form).ajaxSubmit({
				success:function(data){
					switch(data.flag){
					case 1:
						Kit.alert("运单号已使用，请确认");return;
					case 2:
						Kit.alert("订单已发货，请刷新");return;
					/* case -1:
						Kit.alert("网络繁忙...，请重试");return;  */
					case 0:
						/* dataPaginator.loadPage(1); */
						toAddWaybillDialog.close();
						return;
					}
				}
			});
		}
	});
}); 

//判断输入的快递单号格式是否正确    
/* function IsLogisticCode()     
	{     
		var logistics = document.getElementById('logistics').value.trim();
        var logisticCode = document.getElementById('logisticCode').value.trim();    
        if(logisticCode.length!=0){
        	
        reg=/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;    
        
        if(!reg.test(logisticCode)){    
            alert("对不起，您输入的字符串类型格式不正确!");//请将“字符串类型”要换成你要验证的那个属性名称！    
        }    
        }    
	}  */
</script>


	<!-- 详情窗口 -->
<form id="addForm" action="${BASE_PATH}/exchange/order/doAddWaybillForm" method="post" class="form-horizontal" style="">
	<!-- <div class="form-group">
	    <label class="col-lg-2 control-label"><span style="margin-right:10px; color:red;">*</span>市场售价</label>
	    <div class="col-lg-3">
        	<input type="text" name="sellPrice" id="sellPrice" class="form-control" onkeyup="(this.v3=function(){this.value=this.value.replace(/[^0-9-.]+/,'');}).call(this)" onblur="this.v3();" placeholder="请输入商品市场价" />
	    </div>
	</div> -->
	<div class="form-group" >	
		<lable class="col-lg-2 control-label">当前订单号码：</lable>
		<div class="col-lg-4">
		${orderNum}
		</div>
	</div>
	<div class="form-group" >	
		<lable class="col-lg-2 control-label">请选择快递公司：</lable>
		<div class="col-lg-4">
			<select id="charset" name="charset" class="selectpicker" data-width="265px">
				<c:forEach items="${listLogistics}" var="logistics">
					<option value="${logistics.charset}">${logistics.title }</option>
				</c:forEach>
			</select>
		</div>
	</div>
	<div class="form-group" >	
		<lable class="col-lg-2 control-label">请录入运单号码：</lable>
		<div class="col-lg-4">
			<input type="text" class="form-control" name="logisticCode" id="logisticCode" value="" 
				onkeyup="(this.v3=function(){this.value=this.value.replace(/[\W]/g,'');}).call(this)" onblur="this.v3();"
				maxlength="18" placeholder="请输入运单号" />
			<input name="orderNum" id="orderNum" value="${orderNum}" hidden="hidden"/>
		</div>
	</div>
	<div class="form-group" >	
		<lable class="col-lg-2 control-label">请录入运费：</lable>
		<div class="col-lg-4">
			<input type="text" class="form-control" name="orderPay" id="orderPay" value="" 
				onkeyup="(this.v3=function(){this.value=this.value.replace(/[^0-9-.]+/,'');}).call(this)" onblur="this.v3();"
				maxlength="18" placeholder="请输入运费" />
		</div>
	</div>
	<div class="form-group" >	
		<lable class="col-lg-2 control-label">请选择发货公司：</lable>
		<div class="col-lg-4">
<!-- 			<input type="text" class="form-control" name="sendSeller" id="sendSeller" value="" placeholder="请录入发货公司" />
 -->			<select id="sendSeller" name="sendSeller" class="selectpicker" data-width="265px">
				<c:forEach items="${listSendSeller}" var="sendSeller">
					<option value="${sendSeller.sendSellerName}">${sendSeller.sendSellerName }</option>
				</c:forEach>
			</select>
		</div>
	</div>
	<div class="row">
		<div class="col-lg-6"><button class="btn btn-primary col-sm-3 pull-right" type="submit" autocomplete="off" >提交</button></div>
		<div class="col-lg-6"><button class="btn btn-default col-sm-3 pull-left"  type="button" onclick="javascript:toAddWaybillDialog.close();" autocomplete="off">取消</button></div>
	</div>
</form>
